package org.example.service.impl;

import org.example.dao.DepartmentDao;
import org.example.model.Department;
import org.example.model.Teacher;
import org.example.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DepartmentServiceImpl implements DepartmentService {
    @Autowired
    private DepartmentDao departmentDao;
    @Override
    public int addDepartment(Department department) {
        return departmentDao.addDepartment(department);
    }

    @Override
    public int updateDepartment(Department department) {
        return departmentDao.updateDepartment(department);
    }


    @Override
    public int deleteDepartment(int department) {
        return departmentDao.deleteDepartment(department);
    }

    public List<Department> queryDepartment() {
        return departmentDao.queryDepartment();
    }

    @Override
    public Department queryDepartmentById(int departmentId) {
        return departmentDao.queryDepartmentById(departmentId);
    }

    @Override
    public int deleteDepartments(List<Integer> ids) {
        return departmentDao.deleteDepartments(ids);
    }

    @Override
    public List<Department> queryDepartmentByCondition(Map parameters) {
        return departmentDao.queryDepartmentByCondition(parameters);
    }

    @Override
    public List<Map<String, Object>> queryDepartmentDept() {
        return departmentDao.queryDepartmentDept();
    }
}
